<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>办公物品清单</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<import type="js" file="js.jquery" />
<import type="js" file="js.common" />
<import type="css" file="css.global" />
<import type="css" file="css.form" />
<import file="js.tinybox" />
<import file="js.My97DatePicker.WdatePicker" />
<script type="text/javascript">
function checkAll(name) { 
	var el = document.getElementsByTagName('input'); 
	var len = el.length; 
	for(var i=0; i<len; i++) { 
		if((el[i].type=="checkbox") && (el[i].name==name)) { 
			el[i].checked = true; 
		} 
	} 
} 
function clearAll(name) { 
	var el = document.getElementsByTagName('input'); 
	var len = el.length; 
	for(var i=0; i<len; i++) { 
		if((el[i].type=="checkbox") && (el[i].name==name)) { 
			el[i].checked = false; 
		} 
	} 
} 
function CheckForm(){
	var str=document.getElementsByName("supplies_id[]");
	var objarray=str.length;
	var chestr="";
	for (i=0;i<objarray;i++)
	{
	  if(str[i].checked == true)
	  {
	   chestr+=str[i].value+",";
	  }
	}
	if(chestr == "")
	{
	  alert("请至少选择一个办公物品！");
	  return false;
	}
}
</script>
</head>
<body>
<div class="search">
<form action="" method="post" name="form1" onsubmit="return CheckForm();">
	<b>请选择办公物品</b>
</form>
</div>
<form action="__URL__/supplies_use_add"  method="post" name="form1" onsubmit="return CheckForm();">
<div class="list">
<table class="stripe" cellspacing="0">
    <thead>
    <tr>
		<th width="5%">选择</td>
		<th width="15%">物品名称</td>
		<th width="25%" >规格</td>
		<th width="5%">单位</td>
		<th width="5%">单价</td>
		<th width="5%">库存</td>
		<th width="10%">最低库存</td>
	</tr>
	</thead>
	<tbody>
	<volist name="data_list" id="vo">
    <tr>
		<td><input type="checkbox" name="supplies_id[]" value="{$vo.id}" ></td>
		<td>{$vo.supplies_name}</td>
		<td>{$vo.specification}</td>
		<td>{$vo.unit}</td>
		<td>{$vo.unit_price}</td>
		<td>
			<php>if($vo['sum']<$vo['min_number']){</php>
			<font color="red">{$vo.sum}</font>
			<php>}else{ echo $vo['sum'];}</php><input type="hidden" name="sum[]" value="{$vo.sum}" >
		</td>
		<td>{$vo['min_number']}</td>
	</tr>
	</volist>
	</tbody>
	<tr class="TableLine1">
		<td width="5%" nowrap align="center"><input type="checkbox" name="supplies" onclick="if(this.checked==true) { checkAll('supplies_id[]'); } else { clearAll('supplies_id[]'); }" ></td>
		<td width="15%" nowrap colspan="6">
			<input type="hidden" name="tpl" value="{$tpl}" >
			<input type="submit" value="提交" class="BigButton">&nbsp;&nbsp;
	        <input type="button" value="返回" class="BigButton" onClick="history.back();">
		</td>
	</tr>
</table>
</div>
</form>
</body>
</html>
